import re,os

processport=int(input("请输入您要查询的端口号："))

res=os.popen(f'netstat -ano | findstr {processport}').read()
# print(res)
pattern=re.compile('(\d*?)\n')

result=re.findall(pattern,res)
print(result)